/* 
 * ForwardBaseController.java      1.00    2008-01-11
 *
 * Copyright (c) 2010 leewan. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information
 * of leewan.  You shall not disclose such Confidential Information
 * and shall use it only in accordance with the terms of the license agreement
 * you entered into with leewan.
 */
package doit.framework.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.ParameterizableViewController;

import doit.framework.util.AnnotationController;
import doit.framework.util.SharedMethods;

/**
 * <pre>
 * system      : 공통
 * menu        : 공통
 * source      : ForwardBaseController.java
 * description : 공통 Forward 부모 클래스이며 단순 화면(JSP) 이동시 사용한다.
 * </pre> 
 * @version
 * <pre> 
 * 1.0	2008-01-11  leewan  최초 작성
 * 1.1	
 * </pre>
 */

@SuppressWarnings("unchecked")

public class ForwardBaseController extends ParameterizableViewController {
	@Autowired
	private AnnotationController controllerExecuteChecker;
	
	/**
	 * Return a ModelAndView object with the specified view name.
	 * @see #getViewName()
	 */
	protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		String className = SharedMethods.getClassName( this.getClass());
		ModelAndView modelAndView = controllerExecuteChecker.annotation(request, response, className);
		modelAndView = controllerExecuteChecker.sessionChecker(request, response, className);
		
		if( modelAndView == null)
			modelAndView = new ModelAndView(getViewName());
		
		return modelAndView;
	}
}
